import { OpenAI } from "openai";

const openai = new OpenAI({ apiKey: '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' });

async function main() {
  const completion = await openai.chat.completions.create({
    messages: [{ role: "system", content: "请帮我写一篇日记" }],
    model: "gpt-3.5-turbo",
  });

  console.log(completion.choices[0]);
}

main();